@echo off
chcp 65001

REM 建议将jdk安装至 D:\environment
REM set INSTALL_PATH="C:\Program Files\Common Files\Oracle\Java\javapath"

REM 设置用户变量JAVA_HOME
REM setx -m JAVA_HOME_17 "%INSTALL_PATH%" 

setx -m JAVA_HOME_17 "C:\Program Files\Common Files\Oracle\Java\javapath" 
echo path中添加  JAVA_HOME_17 至首行即可

pause
